﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SchEdu.Framework.DataModel;

namespace SchEduApp
{
    public partial class DependencyForm : Form
    {

        DataGridHelper dataGridHelper = new DataGridHelper();


        public DependencyForm()
        {
            InitializeComponent();
            this.dependencyBindSource.DataSource = SchEduAppContext.SchEduData.SchEduDataSet;
            this.orderBindingSource.DataSource = SchEduAppContext.SchEduData.SchEduDataSet;
        }

        private void dependencyGridView_CellValidated(object sender, DataGridViewCellEventArgs e)
        {
            dataGridHelper.ResetError(sender, e);
        }

        private void dependencyGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
        {
            dataGridHelper.Validate(sender, e);
        }

        private void dependencyGridView_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            dependencyStatusStrip.Text = "Invalid Dependency:" + e.Exception.Message;
        }

    }
}
